package com.hu.video.controller;

import com.hu.video.service.ISocialFollowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/socialFollow")
public class SocialFollowController {
    @Autowired
    private ISocialFollowService socialFollowService;

    // 关注接口
    @PostMapping("/follow")
    public String follow(@RequestParam Long followerId, @RequestParam Long followingId) {
        boolean success = socialFollowService.follow(followerId, followingId);
        return success ? "success" : "fail";
    }

    // 取消关注接口
    @PostMapping("/unfollow")
    public String unfollow(@RequestParam Long followerId, @RequestParam Long followingId) {
        boolean success = socialFollowService.unfollow(followerId, followingId);
        return success ? "success" : "fail";
    }
} 